<?php

session_start();

class Session{
	

	public static function setValue($key, $value){
		$_SESSION[$key]=$value;
	}

	
	public static function getValue($key){
		if(isset($_SESSION[$key])) return $_SESSION[$key];
		return null;
	}

	
	public static function clearValue($key){
		unset($_SESSION[$key]);
	}
	
	
	public static function persisteControlerForRedirection($controler){
		$_SESSION['ctrl'][$controler]=$controler::serializeMe();
	}
	
	public static function unserializeControlers(){
		if(isset($_SESSION['ctrl'])){
			foreach($_SESSION['ctrl'] as $ctrlSerialized => $values){
				$ctrlSerialized::unserializeMe($values);
			}
			unset($_SESSION['ctrl']);
		}

	}
	

}

?>